package com.gugee.ins.common.dal.mapper.blogger;

import com.gugee.ins.common.model.ai.InComeResponse;
import com.gugee.ins.common.model.ai.InsBloggerCategory;
import com.gugee.ins.common.model.ai.InsBloggerLanguage;
import com.gugee.ins.common.model.mysql.blogger.InsBlogger;
import com.gugee.ins.common.model.spider.blogger.InsBloggerUserFromId;
import com.gugee.ins.data.common.msg.InsBloggerMessage;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface InsBloggerExtMapper extends InsBloggerMapper {

    int updateByPrimaryKeySelective(InsBloggerUserFromId insBloggerUserFromId);

    /**
     * 批量插入
     * @param insBloggerMessageList
     * @param nowTime
     */
    void batchInsert(@Param("insBloggerMessageList") List<InsBloggerMessage> insBloggerMessageList,
                     @Param("ct")long nowTime);

    /**
     * 插入一个
     * @param insBloggerMessage
     * @param nowTime
     */
    void insertOne(@Param("insBloggerMessage")InsBloggerMessage insBloggerMessage,
                   @Param("ct")long nowTime);

    /**
     * 根据uid 更新年龄和性别
     * @param age
     * @param gender
     * @param birth
     * @param race
     * @param uid
     * @param updateTime
     */
    void updateAiGenderAndAiAgeByUid(@Param("age")int age,@Param("gender")int gender,@Param("birth")int birth,
                                     @Param("race")String race,@Param("uid")long uid,@Param("updateTime")long updateTime);

    /**
     * 根据uid 更新国家
     * @param uid
     * @param nation
     * @param nationSource
     * @param updateTime
     */
    void updateNation(@Param("uid")long uid,@Param("nation")String nation,@Param("nationSource")int nationSource,@Param("updateTime")long updateTime);


    /**
     * 根据uid 更新语言
     * @param uid
     * @param language
     * @param updateTime
     */
    void updateLanguage(@Param("uid")long uid,@Param("language")String language,@Param("updateTime")long updateTime);

    /**
     * 批量更新 语言
     * @param insBloggerLanguages
     * @param updateTime
     */
    void batchUpdateLanguage(@Param("insBloggerLanguages")List<InsBloggerLanguage> insBloggerLanguages,@Param("updateTime")long updateTime);

    /**
     * 根据uids 更新 近30天粉丝增长数和粉丝增长率
     * @param uids
     */
    void updateLastFollowerGrowByUids(@Param("uids")List<Long> uids);

    /**
     * 根据uid条件更新
     * @param insBlogger 数据
     * @return
     */
    void updateByUid(InsBlogger insBlogger);

    /**
     * 更新关注人列表采集时间
     * @param uid
     * @param updateTime
     */
    void updateFollowingCollectTime(@Param("uid")long uid,@Param("updateTime")long updateTime);

    /**
     * 更新真实粉丝占比率
     * @param uid
     * @param realFollowerRate
     */
    void updateRealFollowerRate(@Param("uid")long uid,@Param("realFollowerRate")double realFollowerRate);

    /**
     * 批量更新ai收入
     * @param inComeResponses
     * @param updateTime
     */
    void batchUpdateIncome(@Param("inComeResponses")List<InComeResponse> inComeResponses,@Param("updateTime")long updateTime);

    /**
     * 批量更新ai分类
     * @param insBloggerCategories
     */
    void batchUpdateAiCategory(@Param("insBloggerCategories")List<InsBloggerCategory> insBloggerCategories);

    /**
     * 更新状态
     * @param uid
     * @param status
     */
    void updateAccountStatus(@Param("uid")long uid ,@Param("status")int status);
}